/**
*@Author: QWP
*@Description: 部门相关接口
*@Date 2024-08-06 19:04
*/
import request from '@/http'
// 部门树形
export const tree = async (data: any) => {
  return await request.get({
    url: '/authority/sysTDept/tree/' + data,
  })
}

// 部门有效树形
export const validTree = async (data: any) => {
  return await request.get({
    url: '/authority/sysTDept/validTree/'+ data,
  })
}

// 新增
export const add = async (data: object) => {
  return await request.post({
    url: '/authority/sysTDept',
    data: data
  })
}

// 修改
export const update = async (data: object) => {
  return await request.post({
    url: '/authority/sysTDept/update',
    data: data
  })
}

// 删除
export const del = async (data: Array<any>) => {
  return await request.post({
    url: '/authority/sysTDept/delete',
    data,
    headersType: 'application/x-www-form-urlencoded'
  })
}

// 单体查询
export const singleQuery = async (data: any) => {
  return await request.get({
    url: '/authority/sysTDept/' + data,
  })
}

// // 获取部门下人员
// export const userTree = async (data: object) => {
//   return await request.post({
//     url: '/authority/sysTUser/getUserList/',
//     data: data
//   })
// }

